package com.example.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

public class LoginActivity extends AppCompatActivity {
  @Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.loginlayout);

    Toolbar toolbar=findViewById(R.id.toolbar);
    toolbar.setTitle("登录界面");
    setSupportActionBar(toolbar);
    SetLoginListener();
  }
  public void BackToLastActivity(View view)
  {
    Intent intent = new Intent(this, TableActivity.class);
    startActivity(intent);
  }
  public void GoToNextActivity(View view)
  {
    Intent intent = new Intent(this, ImageViewActivity.class);
    startActivity(intent);
  }
  public void SetLoginListener()
  {
    Button button=(Button) findViewById(R.id.LoginButton);
    button.setOnClickListener(new View.OnClickListener() {
      @Override public void onClick(View v) {
        ShowLogToast();
      }
    });
  }
  public void ShowLogToast()
  {
    Toast.makeText(getApplicationContext(),"正在登录...",Toast.LENGTH_SHORT).show();
  }
}
